package cn.edu.xjtu.data_structure.chapter01_linearlist.doublelinkedlist;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/9/10 9:24
 */
public class DLink<E> {
    //双链表结点类
    private E element;
    private DLink prev;//指向的前一个结点
    private DLink next; //指向的下一个结点

    public DLink(E element, DLink prev, DLink next) {
        this.element = element;
        this.prev = prev;
        this.next = next;
    }

    public DLink(DLink prev, DLink next) {
        this.prev = prev;
        this.next = next;
    }

    //getter和setter
    public E getElement() {
        return element;
    }

    public void setElement(E element) {
        this.element = element;
    }

    public DLink getPrev() {
        return prev;
    }

    public void setPrev(DLink prev) {
        this.prev = prev;
    }

    public DLink getNext() {
        return next;
    }

    public void setNext(DLink next) {
        this.next = next;
    }
}
